How To Use Rsync Commands & The Operations Summary

您所在的位置:网站首页 rsync list How To Use Rsync Commands & The Operations Summary

How To Use Rsync Commands & The Operations Summary

2023-04-21 20:48| 来源: 网络整理| 查看: 265

Using a local machine or a secure network connection, the rsync command synchronizes files from a source to a destination. It serves as a quick, adaptable, and secure alternative to the rcp command. 

A quick and incredibly versatile tool for copying files is rsync. It can copy to or from a remote rsync daemon, another host over any remote shell, or locally. It provides a vast array of controls that allow for very flexible specifications of the list of files to be copied as well as complete control over every aspect of its behavior. It is well-known for its delta-transfer method, which minimizes the amount of data transmitted over the network by only transferring the differences between the source files and the already-existing files at the destination. rsync is frequently used as a better copy command for everyday use, mirroring, and backups.

By default, the "quick check" technique used by rsync looks for files that have changed in size or last-modified time to identify those that need to be transferred. When the fast check shows that the file's data does not require updating, any modifications to the other preserved attributes (as requested by options) are made immediately on the destination file.

rsync has a few more features, including 

1. Copying links, devices, owners, groups, and permissions supported.

2. Like GNU tar, exclude and exclude-from options

3. Use any transparent remote shell, such as ssh or rsh, to ignore the same files that CVS would ignore with a CVS exclude mode.

4. does not call for super-user rights

5. File transfers are pipelined to reduce latency expenses.

6. support for rsync daemons that are anonymous or authenticated (ideal for mirroring)

Syntax:

Local use:

rsync [OPTION...] SOURCE. [DEST]

Access via a remote shell (PULL):  

rsync [OPTION.   ..] [USER@]HOST: SOURCE...... [DESTINATION]

Access via a remote shell (PUSH):  

rsync [OPTION...]SOURCE.....[USER@]HOST: DESTINATION

OPTIONS-v, --verbose increase verbosity-q, --quietsuppress non-error messages-a, --archivemode; equals -rlptgoD (no -H,-A,-X)--no-OPTIONturn off an implied OPTION (e.g., --no-D)-r, --recursiverecurse into directories-R, --relativeuse relative path names-b, --backupmake backups (see --suffix & --backup-dir)-u, --updateskip files that are newer on the receiver--appenddata onto shorter files--append-verify--append w/old data in file checksum-L, --copy-linkstransform symlink into referent file/dir--copy-unsafe-linksonly "unsafe" symlinks are transformed--safe-linksignore symlinks that point outside the tree-k, --copy-dirlinkstransform symlink to dir into referent dir-K, --keep-dirlinkstreat symlinked dir on receiver as dir-H, --hard-linkspreserve hard links-p, --permspreserve permissions-E, --executabilitypreserve executability--chmod=CHMODaffect file and/or directory permissions-X, --xattrspreserve extended attributes-o, --ownerpreserve owner (super user only)-g, --grouppreserve group--devicespreserve device files (super-user only)--specialspreserve special files-Dsame as --devices --specials-t, --timespreserve modification times-O, --omit-dir-timesomit directories from --times--superreceiver attempts super-user activities--fake-superstore/recover privileged attrs using xattrs-x, --one-file-system


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3